<template>
  <div>
    <div class="hello">这里是第1个页面</div>
    <router-link to="/HelloWorld">
      <button class="button">点击跳转</button>
    </router-link>
    <div class="hello" @click="setName">设置name</div>
  </div>
</template>

<script>
export default {
	name: 'page',
	data() {
		return {
			name: 'init',
		};
	},
	methods: {
		setName() {
			// this.$store.commit('changeName', Date.now());
			this.$store.dispatch('changeName', 123);
		},
		goNextPage: () => {
			this.$router.push('HelloWorld');
		},
	},
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1,
h2 {
	font-weight: normal;
}
ul {
	list-style-type: none;
	padding: 0;
}
li {
	display: inline-block;
	margin: 0 10px;
}
a {
	color: #42b983;
}
</style>
